package com.practice.test.lettuce;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yangdejun
 * @date 2021/11/2 10:08
 */
@RestController
@RequestMapping(value = "/lettuce")
public class LettuceTestController {

    @Autowired
    private RedisTemplate<String, String> redisTemplate;

    @GetMapping(value = "/test/{key}")
    public String get(@PathVariable String key) {
        String value = redisTemplate.opsForValue().get(key);
        return value;
    }
}
